package cn.declare.service.impl;

import cn.declare.bean.Material;
import cn.declare.bean.Materialtype;
import cn.declare.dao.MaterialDao;
import cn.declare.service.MaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MaterialServiceImpl implements MaterialService {
    @Autowired
    private MaterialDao materialDao;
//原材料情况
    @Override
    public List<Material> getMaterialList(int pageIndex, String materialTypeName) {
        return materialDao.getMaterialList(pageIndex,materialTypeName);
    }

    @Override
    public int addMaterial(Material material) {
        return materialDao.addMaterial(material);
    }

    @Override
    public Material getMaterialId(int materialId) {
        return materialDao.getMaterialId(materialId);
    }

    @Override
    public int updateMaterial(Material material) {
        return materialDao.updateMaterial(material);
    }

    @Override
    public int deleteMaterial(int materialId) {
        return materialDao.deleteMaterial(materialId);
    }
//原材料类型/
    @Override
    public List<Materialtype> getMaterialtypeList() {
        return materialDao.getMaterialtypeList();
    }

    @Override
    public int addMaterialtype(Materialtype materialtype) {
        return materialDao.addMaterialtype(materialtype);
    }

    @Override
    public int updateMaterialtype(Materialtype materialtype) {
        return materialDao.updateMaterialtype(materialtype);
    }

    @Override
    public int deleteMaterialtypeId(int materialTypeId) {
        return materialDao.deleteMaterialtypeId(materialTypeId);
    }
}
